<style lang="less">
  #deposit{
    width: 80px;
  }
  .el-textarea__inner{
    padding: 5px !important;
  }
</style>
<template>
  <!--弹窗型组件-->
  <div class="box_content">
    <!--房间确认弹窗-->
    <div class="confirmOrder" @mousedown="Drag" v-if="formCon[0]">
      <!--订单内容-->
      <div class="content">
        <div class="top">新增房间</div>
        <div class="tabInfo">
          <el-table
            :data="roomList"
            style="width: 100%;">
            <el-table-column
              prop="roomName"
              label="房型"
              width="80"
              align="center">
            </el-table-column>
            <el-table-column
              prop="roomNo"
              label="房号"
              width="60"
              align="center">
            </el-table-column>
            <el-table-column
              prop="showDate"
              label="日期"
              width="100"
              align="center">
            </el-table-column>
            <el-table-column
              prop="price_strike_price"
              label="执行价"
              width="80"
              align="center">
            </el-table-column>
            <el-table-column
              prop="price_member_price"
              label="分时价"
              width="80"
              align="center">
            </el-table-column>
            <el-table-column label="操作" align="center">
              <template slot-scope="scope">
                <span v-if="scope.$index + 1 == roomList.length">
                  <el-button
                    size="mini"
                    type="danger"
                    @click="handleDelete1(scope.$index)">删除</el-button>
                </span>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>
      <!--按钮组-->
      <div class="buttons">
        <div class="con">
          <el-button type="success" size="medium" @click="confirmRoom">确认</el-button>
        </div>
      </div>
    </div>
    <!--订单支付板块-->
    <div class="orderPayPlate" v-if="formCon[1]">
      <div class="lodingDiv" v-if="paying">
        <div class="loginIcon">
          <img src="../../assets/loading.gif"/>
        </div>
        <div class="loginText">等待微信处理中...</div>
      </div>
      <!--关闭按钮-->
      <i class="el-icon-close close" @click="closePayPlate"></i>
      <div class="title" v-if="!isFirst">{{title}}</div>
      <div class="title" v-else>开房收款</div>
      <!--收款内容-->
      <div class="payContent">
        <!--选择房间-->
        <div class="payCon" v-if="!isFirst && roomList.length > 0">
          <span class="pc_title">选择房间</span>
          <div class="radios" style="margin-top: 8px" v-for="(val,index) in roomList">
            <el-radio v-model="chooseRoomNo" :label="val.id">{{val.house_no}}</el-radio>
          </div>
        </div>
        <!--酒店吧-->
        <div class="barCounter" v-if="showBar">
          <!--商品列表-->
          <div class="commodityList">
            <div class="bc_search">
              <el-select v-model="commodityChoose" @change="commodityChange" placeholder="请选择">
                <el-option
                  v-for="item in commodityList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                >
                </el-option>
              </el-select>
            </div>
            <div class="shopTable">
              <el-table
                border
                :data="shops"
                style="width: 100%">
                <el-table-column label="品类" width="88" align="center">
                  <template slot-scope="scope">
                    <div v-for="(val,index) in commodityList">
                      <div v-if="val.value == scope.row.category">
                        {{val.label}}
                      </div>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column
                  prop="name"
                  label="商品"
                  align="center">
                </el-table-column>
                <el-table-column label="价格" align="center" width="88">
                  <template slot-scope="scope">
                    <div>{{parseFloat(scope.row.price).toFixed(2)}}/{{scope.row.unit}}</div>
                  </template>
                </el-table-column>
                <el-table-column label="" align="center" width="88">
                  <template slot-scope="scope">
                    <el-button type="primary" size="mini" @click="addShop(scope.row.id)" :disabled="addShops.indexOf(scope.row.id) != -1">添加</el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
          </div>
          <div class="hrDiv" v-if="addShopsList.length > 0">已选商品</div>
          <!--已选商品-->
          <div class="alreadyBought" v-if="addShopsList.length > 0">
            <el-table
              border
              :data="addShopsList"
              style="width: 100%">
              <el-table-column
                prop="name"
                label="商品"
                align="center">
              </el-table-column>
              <el-table-column label="价格" align="center" width="88">
                <template slot-scope="scope">
                  <!--<el-input v-model="parseFloat(scope.row.price).toFixed(2)" @change="rowPriceChange(scope.row)" placeholder="请输入价格"></el-input>-->
                  <el-input v-model="scope.row.price" @change="rowPriceChange(scope.row)" placeholder="请输入价格"></el-input>
                </template>
              </el-table-column>
              <el-table-column label="数量" width="150" align="center">
                <template slot-scope="scope">
                  <el-input-number v-model="scope.row.addNum" controls-position="right" :min="1" :max="999" @change="addNumChange(scope.row)" size="small"></el-input-number>
                </template>
              </el-table-column>
              <el-table-column label="小计" width="80" align="center">
                <template slot-scope="scope">
                  <div>{{parseFloat(scope.row.totalPrice).toFixed(2)}}</div>
                </template>
              </el-table-column>
              <el-table-column label="" align="center" width="88">
                <template slot-scope="scope">
                  <el-button type="primary" size="mini" @click="deleteShop(scope.row.shopId)">移除</el-button>
                </template>
              </el-table-column>
            </el-table>
          </div>
        </div>
        <!--收款金额-->
        <div class="payCon" v-if="!isFirst && !parameter_2.is_agreement">
          <span class="pc_title">金额</span>
          <div class="barInputs">
            <div class="input">
              <el-input v-model="payMoney" placeholder="请输入金额" clearable :disabled="showBar"></el-input>
            </div>
            <div class="input" style="float: left;margin-top: 5px" v-show="haveReceivables">
              <el-checkbox v-model="isReceivables">收款</el-checkbox>
            </div>
          </div>
        </div>
        <div class="payCon" v-if="!isFirst && parameter_2.is_agreement">
          <span class="pc_title">挂账金额</span>
          <div class="input">
            <el-input v-model="agreementQuota" @change="agreementQuotaChange" placeholder="请输入金额" :disabled="agreementQuota <= 0"></el-input>
          </div>
          <span class="pc_title">收款金额</span>
          <div class="input">
            <el-input v-model="agreementPay" placeholder="请输入金额" clearable :disabled="true"></el-input>
          </div>
        </div>
        <!--收款账户-->
        <div class="payCon" v-if="isReceivables">
          <span class="pc_title" v-if="payType == 0">收款方式</span>
          <span class="pc_title" v-if="payType == 1">退款方式</span>
          <div class="radios">
            <label class="payCon_label" v-for="(val,index) in hotelaccounts">
              <span v-if="parameter_2.title == '现金退款' || parameter_2.title == '结账-退款'">
                <span v-if="val.id != 2">
                  <el-radio v-model="payRadio" :label="val.id">{{val.name}}</el-radio>
                </span>
              </span>
              <span v-else>
                <el-radio v-model="payRadio" :label="val.id">{{val.name}}</el-radio>
              </span>
            </label>
          </div>
        </div>
        <!--微信收款码-->
        <div class="payCon" v-if="payRadio == 2">
          <span class="pc_title">收款码</span>
          <div class="input">
            <el-input v-model="wxCode" placeholder="请扫描客户微信支付条码" clearable autofocus></el-input>
          </div>
        </div>
        <!--首次进入，默认缴纳房费和押金-->
        <div class="firstPay payCon" v-if="isFirst">
          <div class="roomPrice">
            <span class="pc_title">房费</span>
            <label>{{if_roomPrice}}</label>
          </div>
          <div class="depositPrice">
            <span class="pc_title">押金</span>
            <label><el-input v-model="if_depositPrice" id="deposit" placeholder="请输入押金" size="mini"></el-input></label>
          </div>
        </div>
        <!--收款备注-->
        <div class="payCon">
          <span class="pc_title">备注</span>
          <div class="input" style="width: 70%">
            <el-input v-model="payRemarks" placeholder="可为空" clearable></el-input>
          </div>
        </div>
        <!--总金额（用于默认缴纳情况）-->
        <div class="payCon" v-if="isFirst">
          <span class="pc_title">共计：</span>
          <label style="line-height: 30px;text-align: left">{{if_total}}</label>
        </div>
      </div>
      <!--按钮-->
      <div class="button">
        <el-button type="primary" size="small" @click="confirmPay">确认支付</el-button>
      </div>
    </div>
    <!--收支详情板块-->
    <div class="recordRevenueDetail" v-if="formCon[2]">
      <div class="title" v-if="parameter_3.pay_type == 0">收款详情</div>
      <div class="title" v-if="parameter_3.pay_type == 1">消费详情</div>
      <div class="content">
        <div class="con" v-if="parameter_3.pay_type == 1">
          <div class="con_left">房号：</div>
          <div class="con_right">{{parameter_3.chooseRoom}}</div>
        </div>
        <div class="con" v-if="parameter_3.pay_type != 1">
          <div class="con_left">收款方式：</div>
          <div class="con_right">{{parameter_3.payAccount}}</div>
        </div>
        <div class="con">
          <div class="con_left" v-if="parameter_3.pay_type != 1">收款科目：</div>
          <div class="con_left" v-else>消费科目：</div>
          <div class="con_right">{{parameter_3.paySelect}}</div>
        </div>
        <div class="con" v-if="parameter_3.pay_type != 1">
          <div class="con_left">状态：</div>
          <div class="con_right">{{parameter_3.pay_status}}</div>
        </div>
        <div class="con">
          <div class="con_left" v-if="parameter_3.pay_type != 1">收款金额：</div>
          <div class="con_left" v-else>消费金额：</div>
          <div class="con_right">{{parameter_3.payMoney}}</div>
        </div>
        <div class="con">
          <div class="con_left">操作人：</div>
          <div class="con_right">{{parameter_3.payName}}</div>
        </div>
        <div class="con">
          <div class="con_left" v-if="parameter_3.pay_type != 1">收款时间：</div>
          <div class="con_left" v-else>操作时间：</div>
          <div class="con_right">{{parameter_3.payTime}}</div>
        </div>
        <div class="con">
          <div class="con_left">备注：</div>
          <div class="con_right">{{parameter_3.payRemarks}}</div>
        </div>
        <div class="con">
          <div class="con_left">详情：</div>
          <div class="con_right">{{parameter_3.name}}</div>
        </div>
        <div class="flushing_detail" style="margin-bottom: 10px" v-if="parameter_3.flushingInfo != undefined">
          <el-table
            border
            :data="parameter_3.flushingInfo"
            style="width: 100%">
            <el-table-column
              prop="pay_at"
              label="冲调时间"
              width="110"
              align="center">
            </el-table-column>
            <el-table-column
              prop="money"
              label="冲调金额"
              align="center"
              width="80">
            </el-table-column>
            <el-table-column
              prop="note"
              align="center"
              label="原因"
              width="100">
            </el-table-column>
            <el-table-column
              prop="creator_name"
              align="center"
              label="操作人">
            </el-table-column>
          </el-table>
        </div>
        <div class="button">
          <div class="but_con" @click="printDetail" v-if="parameter_3.subject_id == 2 && parameter_3.pay_status == '已支付'">打印</div>
          <div class="but_con" @click="closerecordRevenue">关闭</div>
        </div>
      </div>
    </div>
    <!--入住信息(入住登记或入住人信息)-->
    <div class="checkInfo" v-if="formCon[3]">
      <div class="title">
        <span>{{parameter_4.roomType}}（{{parameter_4.roomNo}}）</span>
        <span v-if="houst_status == 0">入住登记</span>
        <span v-else>入住信息</span>
      </div>
      <div class="content">
        <div class="con" v-for="(val,index) in checkList">
          <div class="con_name">
            <span>姓名:</span>
            <label v-if="houst_status == 0"><el-input v-model="checkList[index].name" placeholder="请输入姓名" clearable></el-input></label>
            <label v-else>{{checkList[index].name}}</label>
          </div>
          <div class="con_cardType">
            <span>证件类型:</span>
            <label v-if="houst_status == 0">
              <el-select v-model="checkList[index].cardType" placeholder="请选择">
                <el-option
                  v-for="item in cardTypeList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </label>
            <label v-else>{{returnIdCard(checkList[index].cardType)}}</label>
          </div>
          <div class="con_cardId">
            <span>证件号:</span>
            <label style="width: 165px" v-if="houst_status == 0"><el-input v-model="checkList[index].cardId" maxlength="18" placeholder="请输入证件号"></el-input></label>
            <label v-else>{{checkList[index].cardId}}</label>
          </div>
          <div class="con_button" @click="reducePeople(index)" v-if="index != 0 && houst_status == 0"><i class="el-icon-minus"></i></div>
          <div class="con_button" @click="addPeople" v-if="houst_status == 0"><i class="el-icon-plus"></i></div>
        </div>
      </div>
      <div class="button" v-if="houst_status == 0"><el-button size="small" @click="submit">确认登记</el-button></div>
      <div class="button" v-else><el-button size="small" @click="close">关闭</el-button></div>
    </div>
    <!--订单对账板块-->
    <div class="reconciliation" v-if="formCon[4]">
      <div class="title">
        <span>平台对账详情</span>
      </div>
      <div class="content">
        <!--平台应收佣金-->
        <div class="con con_centent" v-if="parameter_5.order_house_data != undefined">
          <span class="con_col con_border">
            <div class="top">总房费</div>
            <div class="bottom">￥{{parameter_5.settlement.house_fee}}</div>
          </span>
          <span class="con_col con_icon">
            <i class="el-icon-close"></i>
          </span>
          <span class="con_col con_border">
            <div class="top">平台佣金比例</div>
            <div class="bottom">6%</div>
          </span>
          <span class="con_col con_icon">
            <div>=</div>
          </span>
          <span class="con_col con_border">
            <div class="top">平台应收佣金</div>
            <div class="bottom">￥{{parameter_5.settlement.commission}}</div>
          </span>
        </div>
        <!--微信总收款大于房费，且是分时订单-->
        <div class="con" v-if="parameter_5.settlement.platform_total_money > parameter_5.settlement.house_fee && parameter_5.order_house_data != undefined">
          <span class="con_col">
            <div class="top">(微信总收款- 房费)</div>
            <div class="bottom">(￥{{parameter_5.settlement.platform_total_money}} - ￥{{parameter_5.settlement.house_fee}})</div>
          </span>
          <span class="con_col">
            <div>*</div>
            <div>*</div>
          </span>
          <span class="con_col">
            <div class="top">微信平台手续费费率</div>
            <div class="bottom">0.6%</div>
          </span>
          <span class="con_col">
            <div class="top">微信手续费</div>
            <div class="bottom">￥{{parameter_5.settlement.third_service_charge}}</div>
          </span>
        </div>
        <!--微信总收款小于等于房费-->
        <div class="con" v-if="parameter_5.settlement.platform_total_money <= parameter_5.settlement.house_fee && parameter_5.order_house_data != undefined">
          <span>微信手续费 = ￥{{parameter_5.settlement.third_service_charge}}</span>
        </div>
        <!--是普通订单-->
        <div class="con" v-if="parameter_5.order_house_data == undefined">
          <span class="con_col">
            <div class="top">微信总收款</div>
            <div class="bottom">￥{{parameter_5.settlement.platform_total_money}}</div>
          </span>
          <span class="con_col">
            <div>*</div>
            <div>*</div>
          </span>
          <span class="con_col">
            <div class="top">微信平台手续费费率</div>
            <div class="bottom">0.6%</div>
          </span>
          <span class="con_col">
            <div class="top">微信手续费</div>
            <div class="bottom">￥{{parameter_5.settlement.third_service_charge}}</div>
          </span>
        </div>
        <!--分时易用豆表格-->
        <div class="con" v-if="parameter_5.order_house_data != undefined">
          <el-table
            border
            :data="parameter_5.order_house_data"
            style="width: 100%">
            <el-table-column
              prop="house_no"
              label="房间"
              width="70"
              align="center">
            </el-table-column>
            <el-table-column
              prop="used_time"
              label="实住时间"
              width="100"
              align="center">
            </el-table-column>
            <el-table-column
              prop="rest_time"
              label="剩余时间"
              width="100"
              align="center">
            </el-table-column>
            <el-table-column
              prop="integral_time"
              label="可存时间"
              width="100"
              align="center">
            </el-table-column>
            <el-table-column
              prop="integral"
              label="获得易用豆"
              align="center">
            </el-table-column>
          </el-table>
        </div>
        <!--分时易用豆提示信息-->
        <div class="con" v-if="parameter_5.order_house_data != undefined">
          <span style="width:100%;text-align: center;font-size: 12px;color: #A6A6A6">易用豆计算公式:（房价/用户购买时间)*(用户购买时间 - 用户实住时间)= 获得易用豆</span>
          <span style="width:100%;text-align: center;font-size: 12px;color: #A6A6A6">用户购买时间默认为24小时，最大可兑换剩余时间为4小时</span>
        </div>
        <!--备注-->
        <div v-if="parameter_5.bill_status == 0" class="con">
          <span style="line-height: 30px">备注：</span>
          <label><el-input v-model="RC_input" placeholder="请输入备注" clearable></el-input></label>
        </div>
        <!--对账时间-->
        <div v-if="parameter_5.bill_status != 0" class="con">
          <span style="line-height: 30px">对账时间：</span>
          <label style="line-height: 30px">{{parameter_5.settlement.confirm_time}}</label>
        </div>
        <!--按钮组-->
        <div class="buttons" v-if="parameter_5.bill_status == 0">
          <el-button type="success" size="mini" @click="buttonSubmit(1)">确认</el-button>
          <el-button type="warning" size="mini" @click="buttonSubmit(2)">质疑</el-button>
        </div>
      </div>
    </div>
    <!--换房板块-->
    <div class="changeRoom" v-if="formCon[5]">
      <div class="title">
        <span>{{oldRoomNo}}({{oldRoomType}})</span>
        <span>换房</span>
      </div>
      <div class="content">
        <!--选择房型-->
        <div class="roomType">
          <span>选择房型</span>
          <label>
            <el-select style="width: 120px" v-model="changeRoomType_selectValue" placeholder="请选择" @change="chooseRoomType">
              <el-option
                v-for="item in changeRoomTypeList"
                :key="item.id"
                :label="item.name"
                :value="item.id">
              </el-option>
            </el-select>
          </label>
        </div>
        <!--可用房型-->
        <div class="roomChoose">
          <span>可选房型</span>
          <label>当前可使用的空房</label>
        </div>
        <!--房间列表-->
        <div class="changeRoomList">
          <div class="rl_radio" v-for="(val,index) in changeRoomList">
            <el-radio v-model="changeRoom_radio" :label="val.house_id">{{val.house_no}}</el-radio>
          </div>
        </div>
        <!--换房天数列表-->
        <div class="changeDaysList">
          <el-table
            :data="changeDays"
            style="width: 100%">
            <el-table-column
              prop="effected_at"
              label="日期"
              width="180"
              align="center">
            </el-table-column>
            <el-table-column label="价格" align="center">
              <template slot-scope="scope">
                <div class="price" style="width: 200px;margin-left: auto;margin-right: auto"><el-input v-model="scope.row.price" placeholder="请输入价格"></el-input></div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <!--备注-->
        <div class="note">
          <span>备注</span>
          <label><el-input style="width: 200px" v-model="changeRoomNote" placeholder="请输入备注" clearable></el-input></label>
        </div>
        <!--按钮组-->
        <div class="buttons">
          <el-button type="primary" size="mini" style="margin-right: 10%" @click="changeHouse">确认换房</el-button>
          <el-button type="info" size="mini" @click="closeChangeRoom">取消换房</el-button>
        </div>
      </div>
    </div>
    <!--续房板块-->
    <div class="continuedRoom" v-if="formCon[6]">
      <div class="title">
        <span>{{oldRoomNo_continued}}({{oldRoomType_continued}})</span>
        <span>续房</span>
      </div>
      <div class="content">
        <!--新增续住天数-->
        <div class="roomType">
          <div class="rt_con">
            <div class="rtc_left">续房时间</div>
            <div class="rtc_center">房价</div>
          </div>
          <div class="rt_con" v-for="(val,index) in houseDaysList_show">
            <div class="rtc_left">{{val.effected_at}}</div>
            <div class="rtc_center"><el-input v-model="houseDaysList_show[index].price" placeholder="请输入房价"></el-input></div>
            <div class="rtc_right">
              <div class="rtc_button" @click="addDay(index)" v-if="houseDaysList_show.length == index + 1"><i class="el-icon-plus"></i></div>
              <div class="rtc_button" @click="deleteDay(index)" v-if="houseDaysList_show.length == index + 1 && houseDaysList_show.length > 1"><i class="el-icon-minus"></i></div>
            </div>
          </div>
        </div>
        <!--备注-->
        <div class="note">
          <span>备注</span>
          <label><el-input style="width: 200px" v-model="continuedNote" placeholder="请输入备注" clearable></el-input></label>
        </div>
        <!--按钮组-->
        <div class="buttons">
          <el-button type="primary" size="mini" style="margin-right: 10%" @click="continuedHouse">确认续房</el-button>
          <el-button type="info" size="mini" @click="closeContinued">取消续房</el-button>
        </div>
      </div>
    </div>
    <!--退房板块-->
    <div class="checkOut" v-if="formCon[7]">
      <div class="title">
        <span>{{parameter_8.house_no}}({{parameter_8.room_name}})</span>
        <span v-if="!parameter_8.isCancel">退房</span>
        <span v-if="parameter_8.isCancel">取消房间</span>
      </div>
      <div class="content" v-if="parameter_8.check_out_type != 2">
        <div class="con con_first">
          <div class="con_left">退房日期</div>
          <div class="con_right" v-if="!parameter_8.isCancel">更改房费</div>
          <div class="con_right" v-if="parameter_8.isCancel">应收房费</div>
        </div>
        <!--房间列表-->
        <div class="con" v-for="(val,index) in checkOutList">
          <div class="con_left">
            <div class="active"><el-checkbox v-model="activeList[index]" @change="activeChoose(index)"></el-checkbox></div>
            <div class="date">{{val.effected_at}}({{val.date_name}})</div>
          </div>
          <div class="con_right"><el-input v-model="val.price" placeholder="请输入价格"></el-input></div>
        </div>
        <!--备注-->
        <div class="con con_rmark">
          <div class="con_left">备注</div>
          <div class="con_right"><el-input v-model="checkOutRmark" placeholder="请输入备注"></el-input></div>
        </div>
        <div class="buttons">
          <div class="but" v-if="!parameter_8.isCancel"><el-button type="success" size="mini" @click="confirmCheckOut">确定</el-button></div>
          <div class="but" v-if="parameter_8.isCancel"><el-button type="success" size="mini" @click="confirmCancel">确定</el-button></div>
          <div class="but"><el-button type="info" size="mini" @click="closeCheckOut">取消</el-button></div>
        </div>
      </div>
      <div class="outTime" v-else>
        <div class="ot_tips">客人已超过预定退房时间{{parameter_8.data.overtime_hours}}小时{{parameter_8.data.overtime_minutes}}分</div>
        <div class="ot_content">
          <div class="otc_con">
            <div class="otc_title">加收类型</div>
            <div class="otc_radios">
              <el-radio v-model="outTimeRadio" label="0">不加收</el-radio>
              <el-radio v-model="outTimeRadio" label="1">钟点房房费</el-radio>
              <el-radio v-model="outTimeRadio" label="2">全日房房费</el-radio>
            </div>
          </div>
          <div class="otc_con" v-if="outTimeRadio != 0">
            <div class="otc_title">金额</div>
            <div class="otc_input"><el-input v-model="outTimeMoney" placeholder="请输入金额"></el-input></div>
          </div>
          <div class="otc_con">
            <div class="otc_title">备注</div>
            <div class="otc_input"><el-input v-model="outTimeRmark" placeholder="请输入备注"></el-input></div>
          </div>
          <div class="otc_con">
            <div class="otc_buttons">
              <el-button type="primary" style="height: 30px;line-height: 30px;padding-top: 0;padding-bottom: 0;" @click="confirmCheckOut">确认</el-button>
              <el-button style="height: 30px;line-height: 30px;padding-top: 0;padding-bottom: 0;" @click="closeCheckOut">取消</el-button>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--交班信息板块-->
    <div class="shifts" v-if="formCon[8]">
      <div class="title">
        <span>交班信息</span>
      </div>
      <div class="content">
        <!--交班信息-->
        <div class="con">
          <!--班次时间-->
          <div class="con_row">
            <div class="row_con">
              <div class="cc_title">班次时间</div>
              <div class="cc_content">{{parameter_9.start_at}} - {{parameter_9.end_at}}</div>
            </div>
          </div>
          <!--班次号、交班人-->
          <div class="con_row">
            <div class="row_con">
              <div class="cc_title">班次号</div>
              <div class="cc_content">{{parameter_9.no}}</div>
            </div>
            <div class="row_con beforTitle">
              <div class="cc_title">交班人</div>
              <div class="cc_content">{{parameter_9.creator_name}}</div>
            </div>
          </div>
        </div>
        <!--收款详情-->
        <div class="con">
          <div class="con_row_title">
            <div class="hr"></div>
            <div class="text">收款统计</div>
          </div>
          <!--总收款-->
          <div class="con_row haveTitle">
            <div class="row_con" style="color: red">
              <div class="cc_title">总收款</div>
              <div class="cc_content">{{parameter_9.total_receipt}}(含押金{{parameter_9.total_deposit}}元)</div>
            </div>
          </div>
          <!--收款详情-->
          <div class="con_row beforTitle">
            <div class="row_con" v-for="(val,index) in parameter_9.receipt_list">
              <div class="cc_title">{{val.name}}</div>
              <div class="cc_content">{{val.money}}<span v-if="val.detail != undefined">  (含押金{{val.detail}})</span></div>
            </div>
          </div>
        </div>
        <!--消费详情-->
        <div class="con">
          <div class="con_row_title">
            <div class="hr"></div>
            <div class="text">消费统计</div>
          </div>
          <!--总消费-->
          <div class="con_row haveTitle">
            <div class="row_con" style="color: red">
              <div class="cc_title">总消费</div>
              <div class="cc_content">{{parameter_9.total_consume}}</div>
            </div>
          </div>
          <!--消费详情-->
          <div class="con_row beforTitle">
            <div class="row_con" v-for="(val,index) in parameter_9.consume_list">
              <div class="cc_title">{{val.name}}</div>
              <div class="cc_content"><span v-if="val.pay_direction == 1">-</span>{{val.money}}</div>
            </div>
          </div>
        </div>
        <!--退款详情-->
        <div class="con">
          <div class="con_row_title">
            <div class="hr"></div>
            <div class="text">退款统计</div>
          </div>
          <!--总退款-->
          <div class="con_row haveTitle">
            <div class="row_con" style="color: red">
              <div class="cc_title">总退款</div>
              <div class="cc_content">-{{parameter_9.total_refund}}</div>
            </div>
          </div>
          <!--退款详情-->
          <div class="con_row beforTitle">
            <div class="row_con" v-for="(val,index) in parameter_9.refund_list">
              <div class="cc_title">{{val.name}}</div>
              <div class="cc_content">-{{val.money}}</div>
            </div>
          </div>
        </div>
        <!--收入统计-->
        <div class="con">
          <div class="con_row_title">
            <div class="hr"></div>
            <div class="text">收入统计</div>
          </div>
          <!--总收入-->
          <div class="con_row haveTitle">
            <div class="row_con" style="color: red">
              <div class="cc_title">总收入</div>
              <div class="cc_content">{{parameter_9.total_income}}</div>
            </div>
          </div>
          <!--收入详情-->
          <div class="con_row beforTitle">
            <div class="row_con" v-for="(val,index) in parameter_9.income_list">
              <div class="cc_title">{{val.name}}</div>
              <div class="cc_content">{{val.money}}<span v-if="val.detail != undefined">  ({{val.detail}})</span></div>
            </div>
          </div>
        </div>
        <!--本班上交下放-->
        <!--<div class="con">-->
          <!--<div class="con_row_title">-->
            <!--<div class="hr"></div>-->
            <!--<div class="text">收入统计</div>-->
          <!--</div>-->
          <!--&lt;!&ndash;提示&ndash;&gt;-->
          <!--<div class="con_row haveTitle">-->
            <!--<div class="row_con">-->
              <!--<div class="cc_title">-->
                <!--&lt;!&ndash;当前现金余额 = 上一班次备用金余额 + 现金收款 - 现金退款&ndash;&gt;-->
                <!--<div class="cct_con">-->
                  <!--<div>当前现金余额</div>-->
                  <!--<div>{{parameter_9.total_cash_money}}</div>-->
                <!--</div>-->
                <!--<div class="cct_icon">-->
                  <!--<div>=</div>-->
                <!--</div>-->
                <!--<div class="cct_con">-->
                  <!--<div>上一班次备用金余额</div>-->
                  <!--<div>{{parameter_9.last_petty_cash_amount}}</div>-->
                <!--</div>-->
                <!--<div class="cct_icon">-->
                  <!--<div>+</div>-->
                <!--</div>-->
                <!--<div class="cct_con">-->
                  <!--<div>现金收款</div>-->
                  <!--<div>{{parameter_9.cash_income_money}}</div>-->
                <!--</div>-->
                <!--<div class="cct_icon">-->
                  <!--<div>-</div>-->
                <!--</div>-->
                <!--<div class="cct_con">-->
                  <!--<div>现金退款</div>-->
                  <!--<div>{{parameter_9.cash_refund_money}}</div>-->
                <!--</div>-->
              <!--</div>-->
            <!--</div>-->
          <!--</div>-->
          <!--&lt;!&ndash;上交下放详情&ndash;&gt;-->
          <!--<div class="con_row">-->
            <!--<div class="row_con">-->
              <!--<div class="cc_title" style="line-height: 40px">现金上交金额</div>-->
              <!--<div class="cc_input"><el-input v-model="shiftsInput_up" placeholder="金额不能为空" @change="inputUpChange"></el-input></div>-->
            <!--</div>-->
            <!--<div class="row_con">-->
              <!--<div class="cc_title" style="line-height: 40px">下放备用金额</div>-->
              <!--<div class="cc_input" style="line-height: 40px">{{shiftsInput_down}}</div>-->
            <!--</div>-->
          <!--</div>-->
        <!--</div>-->
        <!--按钮组-->
        <div class="buttons">
          <el-button type="success" size="small" @click="shifts_confirm">确认</el-button>
          <el-button type="info" size="small" @click="shifts_close">取消</el-button>
        </div>
      </div>
    </div>
    <!--微信退款板块-->
    <div class="wxRefund" v-if="formCon[9]">
      <div class="title">
        <span>微信退款</span>
      </div>
      <div class="content">
        <!--最大可退金额-->
        <div class="con">
          <div class="cc_left">最大可退金额</div>
          <div class="cc_right">{{parameter_10.maxRefund.money}}</div>
        </div>
        <!--退款金额-->
        <div class="con">
          <div class="cc_left">退款金额</div>
          <div class="cc_right"><el-input id="wxRefundInput" v-model="wxRefundInput" placeholder="请输入退款金额"></el-input></div>
        </div>
        <!--退款备注-->
        <div class="con">
          <div class="cc_left">退款备注</div>
          <div class="cc_right"><el-input v-model="wxRefundNote" placeholder="请输入备注"></el-input></div>
        </div>
        <!--按钮组-->
        <div class="buttons">
          <el-button type="success" size="small" @click="refundClick">确认</el-button>
          <el-button type="info" size="small" @click="wxRefundClose">取消</el-button>
        </div>
      </div>
    </div>
    <!--单个房间详情-->
    <div class="houseDetail" v-if="formCon[10]">
      <div class="title">
        <span>{{parameter_11.house_no}}({{parameter_11.room_name}})</span>
        <span>房间详情</span>
      </div>
      <div class="content">
        <el-table
          border
          :data="parameter_11.datas"
          style="width: 100%">
          <el-table-column
            prop="effected_at"
            label="时间"
            width="120"
            align="center">
          </el-table-column>
          <el-table-column label="住房类型" width="80" align="center">
            <template slot-scope="scope">
              <div v-if="scope.row.check_type == 0">全日房</div>
              <div v-if="scope.row.check_type == 1">钟点房</div>
              <div v-if="scope.row.check_type == 2">免费房</div>
              <div v-if="scope.row.check_type == 3">特殊房</div>
            </template>
          </el-table-column>
          <el-table-column
            prop="price"
            label="房价"
            width="80"
            align="center">
          </el-table-column>
          <el-table-column label="入住状态" align="center">
            <template slot-scope="scope">
              <div v-if="scope.row.status == 0">未入住</div>
              <div v-if="scope.row.status == 1">已入住</div>
              <div v-if="scope.row.status == 2">已退房</div>
              <div v-if="scope.row.status == 3">已取消</div>
              <div v-if="scope.row.status == 4">NoShow</div>
            </template>
          </el-table-column>
        </el-table>
        <div class="button">
          <el-button type="success" style="height: 30px;line-height: 30px;padding-top: 0;padding-bottom: 0" @click="closeHouseDetail">确定</el-button>
        </div>
      </div>
    </div>
    <!--冲调板块-->
    <div class="flushing" v-if="formCon[11]">
      <div class="title">
        <span>{{parameter_12.house_no}}</span>
        <span>消费冲调</span>
      </div>
      <div class="content">
        <div class="fc_con">
          <div class="fcc_left">科目</div>
          <div class="fcc_right">{{parameter_12.subject_name}}</div>
        </div>
        <div class="fc_con">
          <div class="fcc_left">可冲调金额</div>
          <div class="fcc_right">{{flushing_total_money}}</div>
        </div>
        <div class="fc_con">
          <div class="fcc_left">冲调方式<div class="icon">*</div></div>
          <div class="fcc_right">
            <el-radio v-model="flushing_radio" label="1" @change="flushingChange">部分冲调</el-radio>
            <el-radio v-model="flushing_radio" label="2" @change="flushingChange">全部冲调</el-radio>
          </div>
        </div>
        <div class="fc_con">
          <div class="fcc_left" style="line-height: 30px">冲调金额<div class="icon">*</div></div>
          <div class="fcc_right"><el-input v-model="flushing_money" placeholder="请输入冲调金额" :disabled="flushing_radio == 2" @blur="flushing_blur"></el-input></div>
        </div>
        <div class="fc_con">
          <div class="fcc_left">原因<div class="icon">*</div></div>
          <div class="fcc_right">
            <el-input
              type="textarea"
              :rows="2"
              placeholder="请输入原因"
              v-model="flushing_note">
            </el-input>
          </div>
        </div>
        <div class="buttons">
          <el-button type="primary" @click="flushingConfirm">确认</el-button>
          <el-button type="info" @click="flushingClose">取消</el-button>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {mapGetters,mapActions} from 'vuex'
    export default {
      props:['box_type','parameter_1','parameter_2','parameter_3','parameter_4','parameter_5','parameter_6','parameter_7','parameter_8','parameter_9','parameter_10','parameter_11','parameter_12'],
      name: "alert-ass",
      computed:mapGetters([
        'hotelaccounts',
        'saveHouseList',
        'publicOrderInfo',
        'showBar'
      ]),
      data() {
        return {
          title:'订单支付',
          formCon:[false,false,false,false,false,false,false,false,false,false],
          /*------------------------房间确定板块-----------------------------*/
          roomList:[], //房价列表
          /*------------------------支付板块-----------------------------*/
          payRadio:'', //收款账户
          paySelect:'押金', //收款科目
          paySelectList:[{ //收款科目列表
            key:'房费',
            val:'房费'
          },{
            key:'押金',
            val:'押金'
          },{
            key:'收款',
            val:'收款'
          },{
            key:'退款',
            val:'退款'
          }],
          payMoney:0, //收款金额
          payRemarks:'', //收款备注
          isFirst:false, //是否是第一次进入（判断是否是房费和押金的第一次缴纳）
          if_roomPrice:0, //第一次进入的房费
          if_depositPrice:0, //第一次进入的押金
          if_total:0, //第一次进入的总费用
          payType:0, //收费方向 0：收款 1：退款
          payInfo:[], //支付信息
          wxCode:'', //微信支付条码
          haveReceivables:false, //是否显示收款按钮
          isReceivables:false, //是否立即收款
          isCheckOut:false, //是否是结账
          paying:false, //支付中显示Loading
          agreementQuota:0, //可用授信额度
          agreementPay:0, //协议客户收款金额
          /*------------------------入住登记板块-----------------------------*/
          houst_status:0, //房间状态，0：未入住 1：已入住
          cardTypeList:[{
            value: '身份证',
            label: '身份证'
          },{
            value: '护照',
            label: '护照'
          },{
            value: '军官证',
            label: '军官证'
          },{
            value: '驾驶证',
            label: '驾驶证'
          },{
            value: '港澳通行证',
            label: '港澳通行证'
          }],//证件类型
          checkList:[{
            name:'',
            cardType:'',
            cardId:''
          }],//入住人列表
          roomList:[], //房间列表
          chooseRoomNo:'', //选择的房间号
          pollingNum:0, //轮询次数
          /*------------------------订单对账板块-----------------------------*/
          RC_input:'', //对账备注
          /*------------------------换房板块-----------------------------*/
          oldRoomId:'',
          oldRoomNo:'',
          oldRoomType:'',
          changeRoomType_selectValue:'', //选择房型下拉列表
          changeRoom_radio:'', //选择的房间
          changeRoomTypeList:[], //房型列表
          changeRoomList:[], //房间列表
          changeRoomNote:'', //换房备注
          changeDays:[], //换房房价列表
          /*------------------------续房板块-----------------------------*/
          oldRoomId_continued:'',
          oldRoomNo_continued:'',
          oldRoomType_continued:'',
          input:'',
          houseDaysList:[], //房间可用续房列表
          houseDaysList_show:[], //房间实际续房列表
          continuedNote:'', //换房备注
          /*------------------------退房板块-----------------------------*/
          checkOutList:[], //房间列表
          activeList:[], //单选框列表
          checkOutRmark:'', //备注
          outTimeRadio:'0', //超时退房单选框
          outTimeMoney:0, //超时退房金额
          outTimeRmark:'', //超时退房备注
          /*------------------------交班板块-----------------------------*/
          shiftsInput_up:0, //现金上交金额
          shiftsInput_down:0, //下放备用金额
          shiftsInput_info:[], //交班数据
          /*------------------------冲调板块-----------------------------*/
          flushing_total_money:0,
          flushing_radio:'1', //冲调方式
          flushing_money:0, //冲调金额
          flushing_note:'', //冲调原因
          /*------------------------微信板块-----------------------------*/
          wxRefundInput:'', //退款金额
          wxRefundNote:'', //退款备注
          /*------------------------酒店吧板块-----------------------------*/
          commodityList: [], //商品品类筛选列表
          commodityChoose: 0, //商品品类筛选选择
          shops: [], //商品列表
          temporaryShops:[], //临时储存的所有商品，不受品类搜索影响
          addShops:[], //添加的商品id集
          addShopsList:[], //添加的商品列表
        }
      },
      watch:{
        //来自房间确认页面
        parameter_1(val) {
          let self = this
          //计算房间，可能存在同一房间开多晚
          let oneDay = 86400000
          let newArr = []
          for (let i = 0; i < val.nightNum; i++){
            newArr.push({
              date:self.timestampToTime(val.createTime + oneDay * i),
              price:167 + i,
              roomName:val.roomName,
              roomNo:val.roomNo,
              roomStatus:val.roomStatus
            })
          }
          self.roomList = newArr
        },
        //来自支付页面
        parameter_2(val) {
          let self = this
          //初始化数据
          self.haveReceivables = false
          self.upstate({key:'showBar',val:false})
          self.roomList = []
          self.if_total,self.payMoney = 0
          //更新数据
          if (val.isFirst){
            self.isFirst = val.isFirst
            self.if_roomPrice = val.par.orderNextPay.house_fee
            self.if_depositPrice = val.par.orderNextPay.deposit
            self.if_total = parseFloat(self.if_roomPrice) + parseFloat(self.if_depositPrice)
            self.isReceivables = true
            self.haveReceivables = false
            self.upstate({key:'showBar',val:false})
          }else {
            let data = val
            self.title = data.title
            if (data.houseList == undefined){
              self.payMoney = data.payMoney
              self.payType = data.payType
            }else {
              self.roomList = data.houseList
            }
            if (data.haveReceivables){
              self.isReceivables = false
              self.haveReceivables = true
              self.upstate({key:'showBar',val:true})
            }else {
              self.isReceivables = true
              self.haveReceivables = false
              self.upstate({key:'showBar',val:false})
            }
          }
        },
        //监听押金变化
        if_depositPrice(val){
          let self = this
          self.if_total = parseFloat(self.if_roomPrice) + parseFloat(val)
        },
        //超时退房单选框变化
        outTimeRadio(val){
          let self = this
          if (val == 0){
            self.outTimeMoney = 0
          }else if (val == 1){
            self.outTimeMoney = self.parameter_8.data.hour_room_price
          }else if (val == 2){
            self.outTimeMoney = self.parameter_8.data.day_price
          }
        },
        //监听酒店吧添加/移除商品变化
        addShops(val){
          let self = this
          let oldList = self.addShopsList
          let newArr = []
          for (let i = 0; i < val.length; i++){
            for (let n = 0; n < self.temporaryShops.length; n++){
              if (val[i] == self.temporaryShops[n].id){
                newArr.push({
                  id:self.temporaryShops[n].id,
                  shopId:self.temporaryShops[n].id,
                  name:self.temporaryShops[n].name,
                  category: self.temporaryShops[n].category,
                  price: self.temporaryShops[n].price,
                  addNum: 1,
                })
                newArr[i].totalPrice = parseFloat(newArr[i].addNum) * parseFloat(newArr[i].price)
              }
            }
          }
          if (oldList.length > 0 && newArr.length > 0){
            for (let x = 0; x < newArr.length; x++){
              for (let y = 0; y < oldList.length; y++){
                if (newArr[x].id == oldList[y].id){
                  newArr[x].addNum = oldList[y].addNum
                  newArr[x].price = oldList[y].price
                  newArr[x].totalPrice = parseFloat(newArr[x].addNum) * parseFloat(newArr[x].price)
                }
              }
            }
          }
          self.addShopsList = newArr
        },
        //监听已选商品变化
        addShopsList(val){
          let self = this
          let total = 0
          if (val.length > 0){
            for (let i = 0; i < val.length; i++){
              total += parseFloat(val[i].totalPrice)
            }
            self.payMoney = total.toFixed(2)
          }
        },
        //监听收款按钮点击事件
        isReceivables(val){
          let self = this
          if (val && self.showBar){
            setTimeout(() => {
              $('.orderPayPlate .payContent .payCon .pc_title').css({'width':'12%'})
            },1)
          }
        },
      },
      created() {
        let self = this
        let formType = self.box_type //父级组件传来的参数，1：订单确认  2：实时房态  3：订单操作  4：订单支付 5：订单对账 6：换房 7：续房 8：提前退房 9：交班信息 10：微信退款 11：单个房间详情 12：冲调
        if (formType == 1){ //订单确认
          self.formCon = [true,false,false,false,false,false,false,false,false,false,false,false]
        }else if (formType == 2){
          self.formCon = [false,true,false,false,false,false,false,false,false,false,false,false]
        }else if (formType == 3){
          self.formCon = [false,false,true,false,false,false,false,false,false,false,false,false]
        }else if (formType == 4){
          self.formCon = [false,false,false,true,false,false,false,false,false,false,false,false]
        }else if (formType == 5){
          self.formCon = [false,false,false,false,true,false,false,false,false,false,false,false]
        }else if (formType == 6){
          self.formCon = [false,false,false,false,false,true,false,false,false,false,false,false]
        }else if (formType == 7){
          self.formCon = [false,false,false,false,false,false,true,false,false,false,false,false]
        }else if (formType == 8){
          self.formCon = [false,false,false,false,false,false,false,true,false,false,false,false]
        }else if (formType == 9){
          self.formCon = [false,false,false,false,false,false,false,false,true,false,false,false]
        }else if (formType == 10){
          self.formCon = [false,false,false,false,false,false,false,false,false,true,false,false]
        }else if (formType == 11){
          self.formCon = [false,false,false,false,false,false,false,false,false,false,true,false]
        }else if (formType == 12){
          self.formCon = [false,false,false,false,false,false,false,false,false,false,false,true]
        }
        //处理来源信息 1：来自于房间确认页面 2：来自于支付页面 4：来自于入住登记页面
        if (self.box_type == 1){
          //计算房间，可能存在同一房间开多晚
          let newArr = []
          for (let i = 0; i < self.parameter_1.prices.length; i++){
            let a = 1 //房间状态， 1：已锁定 2：已入住 3：已离店
            let roomS
            if (a == 1){
              roomS = '已锁定'
            }else if (a == 2){
              roomS = '已入住'
            }else {
              roomS = '已离店'
            }
            newArr.push({
              roomId:self.parameter_1.roomId,
              date:self.parameter_1.prices[i].planned_at,
              showDate:self.parameter_1.prices[i].planned_at.substring(5,self.parameter_1.prices[i].planned_at.length),
              price:self.parameter_1.prices[i].strike_price + '/' + self.parameter_1.prices[i].member_price,
              price_strike_price:self.parameter_1.prices[i].strike_price,
              price_member_price:self.parameter_1.prices[i].member_price,
              strike_price:self.parameter_1.prices[i].strike_price,
              member_price:self.parameter_1.prices[i].member_price,
              roomName:self.parameter_1.roomName,
              roomNo:self.parameter_1.roomNo,
              roomStatus:roomS,
              hour_room_price:self.parameter_1.prices[i].hour_room_price,
              agreement_price:self.parameter_1.prices[i].agreement_price
              // roomStatus:self.parameter_1.roomStatus
            })
          }
          self.roomList = newArr
        }else if (self.box_type == 2){
          self.chooseRoomNo = ''
          self.payRadio = ''
          self.isReceivables = false
          if (self.parameter_2.isFirst){
            self.isFirst = self.parameter_2.isFirst
            self.if_roomPrice = self.parameter_2.par.orderNextPay.house_fee
            self.if_depositPrice = self.parameter_2.par.orderNextPay.deposit
            self.if_total = parseFloat(self.if_roomPrice) + parseFloat(self.if_depositPrice)
            self.isReceivables = true
            self.haveReceivables = false
            self.upstate({key:'showBar',val:false})
          }else {
            let data = self.parameter_2
            if (data.is_agreement == undefined){
              self.title = data.title
              if (data.houseList == undefined){
                self.payMoney = data.payMoney
                self.payType = data.payType
              }else {
                self.roomList = data.houseList
                self.chooseRoomNo = self.roomList[0].id
              }
              if (data.haveReceivables){
                self.isReceivables = false
                self.haveReceivables = true
                self.upstate({key:'showBar',val:true})
              }else {
                self.isReceivables = true
                self.haveReceivables = false
                self.upstate({key:'showBar',val:false})
              }
              if (data.is_Checkout != undefined && data.is_Checkout){
                self.isCheckOut = true
              }else {
                self.isCheckOut = false
              }
            }else {
              if (data.is_agreement){
                self.title = data.title
                self.payMoney = data.payMoney
                self.payType = data.payType
                self.isReceivables = true
                self.haveReceivables = false
                self.upstate({key:'showBar',val:false})
                if (data.is_Checkout != undefined && data.is_Checkout){
                  self.isCheckOut = true
                }else {
                  self.isCheckOut = false
                }
                if (parseFloat(data.creditLine) >= parseFloat(self.payMoney)){
                  self.agreementQuota = parseFloat(self.payMoney)
                }else {
                  self.agreementQuota = data.creditLine
                }
                self.agreementPay = parseFloat(self.payMoney) - parseFloat(self.agreementQuota)
              }
            }
          }
        }else if (self.box_type == 4){
          if (self.parameter_4.houst_status != undefined){
            self.houst_status = self.parameter_4.houst_status
          }else {
            self.houst_status = 0
          }
          if (self.parameter_4.list != undefined){
            self.checkList = self.parameter_4.list
          }
        }else if (self.box_type == 6){
          self.oldRoomId = self.parameter_6.parameter.curRoom.house_id
          self.oldRoomNo = self.parameter_6.parameter.curRoom.house_no
          self.oldRoomType = self.parameter_6.parameter.curRoom.room_name
          let newArr = []
          for (let i = 0; i < self.parameter_6.parameter.roomList.length; i++){
            newArr.push({
              id:self.parameter_6.parameter.roomList[i].id,
              name:self.parameter_6.parameter.roomList[i].name
            })
          }
          self.changeRoomTypeList = newArr
          self.changeRoomType_selectValue = self.parameter_6.parameter.curRoom.room_name
          let newArr2 = []
          let newArr3 = []
          for (let i = 0; i < self.parameter_6.parameter.roomList.length; i++){
            if (self.parameter_6.parameter.curRoom.room_id == self.parameter_6.parameter.roomList[i].id){
              for (let n = 0; n < self.parameter_6.parameter.roomList[i].rssc_houses.length; n++){
                if (self.parameter_6.parameter.roomList[i].rssc_houses[n].book_lock_status == 0){
                  newArr2.push({
                    house_id:self.parameter_6.parameter.roomList[i].rssc_houses[n].id,
                    house_no:self.parameter_6.parameter.roomList[i].rssc_houses[n].no
                  })
                }
              }
              //将换房价格、时间放入视图层
              for (let x = 0; x < self.parameter_6.parameter.roomList[i].prices.length; x++){
                newArr3.push({
                  effected_at:self.parameter_6.parameter.roomList[i].prices[x].date,
                  price:self.parameter_6.parameter.roomList[i].prices[x].price
                })
              }
            }
          }
          self.changeRoomList = newArr2
          if (self.changeRoomList.length > 0){
            self.changeDays = newArr3
          }
        }else if (self.box_type == 7){
          self.oldRoomId_continued = self.parameter_7.order_house_id
          self.oldRoomNo_continued = self.parameter_7.house_no
          self.oldRoomType_continued = self.parameter_7.room_name
          self.$http.post(self.conURL + 'hotel/work/getextendhousedays',{order_house_id:self.oldRoomId_continued}).then(res => {
            if (res.data.code == 0){
              self.houseDaysList = res.data.data
              if (self.houseDaysList.max_night > 0){
                let newArr = []
                newArr.push(self.houseDaysList.priceList[0])
                self.houseDaysList_show = newArr
              }else {
                this.$message.error('该房间' + self.houseDaysList.booked_date + '已被预订');
              }
            }else {
              self.createMess(res.data.msg)
            }
          })
        }else if (self.box_type == 8){
          if (self.parameter_8.data != undefined){
            self.outTimeRadio = '0'
          }else {
            self.checkOutList = self.parameter_8.house_list
            let newArr = []
            for (let i = 0; i < self.checkOutList.length; i++){
              // self.checkOutList[i].active = false
              newArr.push(false)
            }
            self.activeList = newArr
          }
        }else if (self.box_type == 12){
          self.flushing_total_money = self.parameter_12.money
        }
      },
      mounted() {
        let self = this
        if (self.showBar){
          $('.orderPayPlate').css({'width':'700px'})
          $('.orderPayPlate .payContent .payCon .pc_title').css({'width':'12%'})
          self.getBarList(0)
          let barList = JSON.parse(sessionStorage.getItem('barList'))
          let newArr = [] //临时的商品品类列表
          for (let i = 0; i < barList.length; i++){
            newArr.push({
              value:barList[i].id,
              label:barList[i].name
            })
          }
          newArr.unshift({
            value:0,
            label:'全部品类'
          })
          self.commodityList = newArr
          let newArr2 = [] //临时的商品列表
          for (let x = 0; x < barList.length; x++){
            for (let y = 0; y < barList[x].goods.length; y++){
              newArr2.push({
                id:barList[x].goods[y].id,
                category: barList[x].goods[y].category_id,
                name: barList[x].goods[y].name,
                unit:barList[x].goods[y].company,
                price: barList[x].goods[y].price,
              })
            }
          }
          self.temporaryShops = newArr2
        }
      },
      methods:{
        ...mapActions([
          'upstate'
        ]),
        /*-----------------------公共方法-------------------------------*/
        //时间戳转换为日期
        timestampToTime(timestamp) {
          let date = new Date(timestamp);//时间戳为10位需*1000，时间戳为13位的话不需乘1000
          let Y = date.getFullYear() + '-';
          let M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
          let D = date.getDate() + ' ';
          return Y+M+D;
        },
        //接口请求失败，提示信息
        createMess(msg){
          let self = this
          this.$notify.error({
            title: '提示',
            message: msg
          });
          self.upstate({key:'public_bc',val:false})
          },
        //拖拽事件
        Drag(e){
          let self = this
          // console.log(e)
        },
        /*-----------------------房间确认板块方法-------------------------------*/
        //删除已选房间(确认房间弹窗)
        handleDelete1(index) {
          let self = this
          self.roomList.splice(index,1)
        },
        //确认房间按钮点击事件
        confirmRoom() {
          let self = this
          let parameter = []
          if (self.saveHouseList.length == 0){
            let newArr = []
            for (let i = 0;i < self.roomList.length; i++){
              newArr.push({
                roomId:self.roomList[i].roomId,
                date:self.roomList[i].date
              })
            }
            self.upstate({key:'saveHouseList',val:newArr})
            parameter = self.roomList //将房间信息回传
          }else {
            let newArr = self.saveHouseList
            for (let i = 0;i < self.roomList.length; i++){
              newArr.push({
                roomId:self.roomList[i].roomId,
                date:self.roomList[i].date
              })
            }
            self.upstate({key:'saveHouseList',val:newArr})
            parameter = self.roomList //将房间信息回传
          }
          self.upstate({key:'public_bc',val:false})
          self.$emit('backParameter',parameter)
        },
        /*-----------------------支付板块方法-------------------------------*/
        //关闭支付板块
        closePayPlate() {
          let self = this
          self.paying = false
          self.pollingNum = 6
          self.upstate({key:'public_bc',val:false})
          if (self.parameter_2.isFirst){
            self.upstate({key:'payInfo',val:self.parameter_2.par.payments})
            self.$emit('backParameter',self.parameter_2.par)
          }else {
            self.$emit('backParameter','close')
          }
        },
        //确认支付按钮点击事件
        confirmPay()  {
          let self = this
          self.upstate({key:'public_is_Loading',val:true})
          let third_pay_code
          if (self.payRadio == 2){ //判断是否选择微信账户
            if (self.wxCode == ''){ //如果选择了微信账户，判断是否使用扫码枪
              self.createMess('请使用扫码枪扫描客户出示的微信条码')
            }else {
              third_pay_code = self.wxCode
            }
          }else {
            third_pay_code = ''
          }
          let order_id = ''
          // console.log(self.parameter_2,632)
          if(self.parameter_2.order_id &&  self.parameter_2.order_id != null){
            order_id = self.parameter_2.order_id
          }else if (self.parameter_2.par.order_id != undefined && self.parameter_2.par.order_id != null){
            order_id = self.parameter_2.par.order_id
          }
          if (self.isFirst){
            let par = {
              order_id: order_id,
              num: 1,
              money: self.if_total,
              subject_id: "2",
              account_id: self.payRadio,
              note: self.payRemarks,
              deposit:self.if_depositPrice,
            }
            if (third_pay_code != ''){
              par.third_pay_code = third_pay_code
            }
            self.$http.post(self.conURL + 'hotel/work/createpay',par).then(res => {
              if (res.data.code == 0){
                self.upstate({key:'public_is_Loading',val:false})
                // console.log(res.data.data,'res')
                let dataResult = res.data.data
                let parameter = { //生成订单信息
                  bill_status:dataResult.bill_status,
                  order_id:dataResult.id, //订单ID
                  order_No:dataResult.no, //订单编号
                  orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                  orderPeopleId:dataResult.member_id, //会员ID
                  orderPeopleName:dataResult.book_name, //预定人
                  orderPeopleTel:dataResult.book_phone, //预订人电话
                  orderCreatedId:dataResult.creator_id, //创建人ID
                  orderCreatedName:dataResult.creator_name, //创建人姓名
                  orderCreatedTime:dataResult.created_at, //创建时间
                  orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                  orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                  otaName:dataResult.ota_name, //OTA名称
                  ota_order_type:dataResult.ota_order_type, //OTA类型
                  otaNo:dataResult.ota_no, //OTA单号
                  orderRemarks:dataResult.note, //备注
                  orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                  order_parameter:dataResult.order_houses, //房间列表
                  orderNextPay:dataResult.nextpay, //第一次支付
                  orderPayments:dataResult.payments, //收支明细
                  payCount:dataResult.payCount, //收支详情板块的三个数据
                  printData:dataResult.printData, //打印数据
                }
                // console.log(parameter,'parameter')
                self.upstate({key:'publicOrderInfo',val:parameter})
                self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                if (res.data.data.weixin_pay != undefined){ //是微信支付
                  if (res.data.data.weixin_pay.pay_status == 1){ //是支付中
                    self.paying = true
                    setTimeout(() => {
                      self.polling(res.data.data.weixin_pay.id,parameter)
                    },5000)
                  }else { //不是支付中
                    self.$emit('backParameter',parameter)
                  }
                }else {
                  self.$emit('backParameter',parameter)
                }
              }else {
                self.upstate({key:'public_is_Loading',val:false})
                self.createMess(res.data.msg)
              }
            })
          }else {
            if (self.parameter_2.is_agreement == undefined){ //不是协议客户的结账
              let par = {
                order_id: order_id,
                num: 1,
                money: self.payMoney,
                subject_id: self.parameter_2.subject_id,
                account_id: self.payRadio,
                note: self.payRemarks,
                order_house_id:self.chooseRoomNo,
                deposit:self.payMoney,
              }
              if (self.parameter_2.is_Checkout != undefined && self.parameter_2.is_Checkout){
                par.is_order_done = 1
              }
              if (third_pay_code != ''){
                par.third_pay_code = third_pay_code
              }
              if (self.parameter_2.subject_id != 5){
                self.$http.post(self.conURL + 'hotel/work/createpay',par).then(res => {
                  if (res.data.code == 0){
                    self.upstate({key:'public_is_Loading',val:false})
                    let dataResult = res.data.data
                    let parameter = []
                    if (self.parameter_2.isConfirm == undefined){ //不是来源于预订订单
                      parameter = { //生成订单信息
                        bill_status:dataResult.bill_status,
                        order_id:dataResult.id, //订单ID
                        order_No:dataResult.no, //订单编号
                        orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                        orderPeopleId:dataResult.member_id, //会员ID
                        orderPeopleName:dataResult.book_name, //预定人
                        orderPeopleTel:dataResult.book_phone, //预订人电话
                        orderCreatedId:dataResult.creator_id, //创建人ID
                        orderCreatedName:dataResult.creator_name, //创建人姓名
                        orderCreatedTime:dataResult.created_at, //创建时间
                        orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                        orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                        otaName:dataResult.ota_name, //OTA名称
                        ota_order_type:dataResult.ota_order_type, //OTA类型
                        otaNo:dataResult.ota_no, //OTA单号
                        orderRemarks:dataResult.note, //备注
                        orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                        order_parameter:dataResult.order_houses, //房间列表
                        orderNextPay:dataResult.nextpay, //第一次支付
                        orderPayments:dataResult.payments, //收支明细
                        payCount:dataResult.payCount, //收支详情板块的三个数据
                        printData:dataResult.printData, //打印数据
                      }
                      if (dataResult.order_status == 3){
                        if (res.data.data.weixin_pay != undefined){ //是微信支付
                          if (res.data.data.weixin_pay.pay_status == 1){ //是支付中
                            self.paying = true
                            setTimeout(() => {
                              self.polling(res.data.data.weixin_pay.id,parameter)
                            },5000)
                          }else { //不是支付中
                            self.$emit('backParameter',parameter)
                          }
                        }else {
                          self.$emit('backParameter',parameter)
                        }
                        self.$http.post(self.conURL + 'hotel/hotel/printdetail',{order_id:dataResult.id}).then(ress => {
                          if(ress.data.code == 0){
                            self.upstate({key:'jzPrint',val:ress.data.data})
                          }else {
                            self.createMess(ress.data.msg)
                          }
                        })
                      }
                      // console.log(parameter,'parameter')
                      self.upstate({key:'publicOrderInfo',val:parameter})
                      self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                    }else {
                      parameter = { //生成订单信息
                        bill_status:dataResult.bill_status,
                        order_id:dataResult.id, //订单ID
                        order_No:dataResult.no, //订单编号
                        orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                        orderPeopleId:dataResult.member_id, //会员ID
                        orderPeopleName:dataResult.book_name, //预定人
                        orderPeopleTel:dataResult.book_phone, //预订人电话
                        orderCreatedId:dataResult.creator_id, //创建人ID
                        orderCreatedName:dataResult.creator_name, //创建人姓名
                        orderCreatedTime:dataResult.created_at, //创建时间
                        orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                        orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                        otaName:dataResult.ota_name, //OTA名称
                        ota_order_type:dataResult.ota_order_type, //OTA类型
                        otaNo:dataResult.ota_no, //OTA单号
                        orderRemarks:dataResult.note, //备注
                        orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                        order_parameter:dataResult.lock_houses, //房间列表
                        payCount:dataResult.payCount, //收支详情板块的三个数据
                        payments:dataResult.payments, //收支详情列表
                        isConfirm:true
                      }
                    }
                    // self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传

                    if (res.data.data.weixin_pay != undefined){ //是微信支付
                      if (res.data.data.weixin_pay.pay_status == 1){ //是支付中
                        self.paying = true
                        setTimeout(() => {
                          self.polling(res.data.data.weixin_pay.id,parameter)
                        },5000)
                      }else { //不是支付中
                        self.$emit('backParameter',parameter)
                      }
                    }else {
                      self.$emit('backParameter',parameter)
                    }
                    // console.log(res.data.data,'res')
                  }else {
                    self.upstate({key:'public_is_Loading',val:false})
                    self.createMess(res.data.msg)
                  }
                })
              }else {
                let goodsList = []
                for (let i = 0; i < self.addShopsList.length; i++){
                  goodsList.push({
                    price:self.addShopsList[i].price,
                    num:self.addShopsList[i].addNum,
                    goods_id:self.addShopsList[i].id,
                    category_id:self.addShopsList[i].category,
                  })
                }
                par.goodsList = goodsList
                self.$http.post(self.conURL + 'hotel/work/createconsume',par).then(res => {
                  if (res.data.code == 0){
                    self.upstate({key:'public_is_Loading',val:false})
                    // console.log(res.data.data,'res')
                    let dataResult = res.data.data
                    let parameter = { //生成订单信息
                      bill_status:dataResult.bill_status,
                      order_id:dataResult.id, //订单ID
                      order_No:dataResult.no, //订单编号
                      orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                      orderPeopleId:dataResult.member_id, //会员ID
                      orderPeopleName:dataResult.book_name, //预定人
                      orderPeopleTel:dataResult.book_phone, //预订人电话
                      orderCreatedId:dataResult.creator_id, //创建人ID
                      orderCreatedName:dataResult.creator_name, //创建人姓名
                      orderCreatedTime:dataResult.created_at, //创建时间
                      orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                      orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                      otaName:dataResult.ota_name, //OTA名称
                      ota_order_type:dataResult.ota_order_type, //OTA类型
                      otaNo:dataResult.ota_no, //OTA单号
                      orderRemarks:dataResult.note, //备注
                      orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                      order_parameter:dataResult.order_houses, //房间列表
                      orderNextPay:dataResult.nextpay, //第一次支付
                      orderPayments:dataResult.payments, //收支明细
                      payCount:dataResult.payCount, //收支详情板块的三个数据
                    }
                    // console.log(parameter,'parameter')
                    self.upstate({key:'publicOrderInfo',val:parameter})
                    self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传

                    if (res.data.data.weixin_pay != undefined){ //是微信支付
                      if (res.data.data.weixin_pay.pay_status == 1){ //是支付中
                        self.paying = true
                        setTimeout(() => {
                          self.polling(res.data.data.weixin_pay.id,parameter)
                        },5000)
                      }else { //不是支付中
                        self.$emit('backParameter',parameter)
                      }
                    }else {
                      self.$emit('backParameter',parameter)
                    }
                  }else {
                    self.upstate({key:'public_is_Loading',val:false})
                    self.createMess(res.data.msg)
                  }
                })
              }
            }else {
              //协议客户的结账
              let par = {
                order_id: order_id,
                agreement_money: self.agreementQuota,
                receipt_money:self.agreementPay,
                subject_id: self.parameter_2.subject_id,
                account_id: self.payRadio,
                note: self.payRemarks,
              }
              if (self.parameter_2.is_Checkout != undefined && self.parameter_2.is_Checkout){
                par.is_order_done = 1
              }
              if (third_pay_code != ''){
                par.third_pay_code = third_pay_code
              }
              self.$http.post(self.conURL + 'hotel/work/agreementsettleaccount',par).then(res => {
                if (res.data.code == 0){
                  self.upstate({key:'public_is_Loading',val:false})
                  // console.log(res.data.data,'res')
                  let dataResult = res.data.data
                  let parameter = { //生成订单信息
                    bill_status:dataResult.bill_status,
                    order_id:dataResult.id, //订单ID
                    order_No:dataResult.no, //订单编号
                    orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                    orderPeopleId:dataResult.member_id, //会员ID
                    orderPeopleName:dataResult.book_name, //预定人
                    orderPeopleTel:dataResult.book_phone, //预订人电话
                    orderCreatedId:dataResult.creator_id, //创建人ID
                    orderCreatedName:dataResult.creator_name, //创建人姓名
                    orderCreatedTime:dataResult.created_at, //创建时间
                    orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                    orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                    otaName:dataResult.ota_name, //OTA名称
                    ota_order_type:dataResult.ota_order_type, //OTA类型
                    otaNo:dataResult.ota_no, //OTA单号
                    orderRemarks:dataResult.note, //备注
                    orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                    order_parameter:dataResult.order_houses, //房间列表
                    orderNextPay:dataResult.nextpay, //第一次支付
                    orderPayments:dataResult.payments, //收支明细
                    payCount:dataResult.payCount, //收支详情板块的三个数据
                    // printData:dataResult.printData, //打印数据
                  }
                  // console.log(parameter,'parameter')
                  self.upstate({key:'publicOrderInfo',val:parameter})
                  self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                  self.upstate({key:'jzPrint',val:dataResult.printData.data})
                  if (res.data.data.weixin_pay != undefined){ //是微信支付
                    if (res.data.data.weixin_pay.pay_status == 1){ //是支付中
                      self.paying = true
                      setTimeout(() => {
                        self.polling(res.data.data.weixin_pay.id,parameter)
                      },5000)
                    }else { //不是支付中
                      self.$emit('backParameter',parameter)
                    }
                  }else {
                    self.$emit('backParameter',parameter)
                  }
                }else {
                  self.upstate({key:'public_is_Loading',val:false})
                  self.createMess(res.data.msg)
                }
              })
            }
          }
        },
        //轮询查看微信支付是否成功
        polling(payment_id,parameter){
          let self = this
          //五次轮询，三十秒后，停止轮询
          if (self.pollingNum != 6){
            self.$http.post(self.conURL + 'hotel/work/querypay',{
              payment_id:payment_id
            }).then(res => {
              if (res.data.code == 0){
                // console.log(res.data.data.pay_status,'轮询')
                console.log(self.pollingNum,'轮询次数')
                if (res.data.data.pay_status == 1){
                  setTimeout(() => {
                    self.polling(payment_id,parameter)
                    self.pollingNum++
                  },5000)
                }else {
                  self.pollingNum = 0
                  self.$emit('backParameter',parameter)
                }
              }else {
                self.createMess(res.data.msg)
              }
            })
          }else {
            self.pollingNum = 0
            self.$emit('backParameter',parameter)
          }
        },
        //协议客户结账，挂账金额变化
        agreementQuotaChange(val){
          let self = this
          if (self.payMoney < self.parameter_2.creditLine){
            if (val >= self.payMoney){
              self.agreementQuota = self.payMoney
            }
          }else {
            self.agreementQuota = self.parameter_2.creditLine
          }
          self.agreementPay = parseFloat(self.payMoney) - parseFloat(self.agreementQuota)
        },
        /*-----------------------收支详情方法-------------------------------*/
        closerecordRevenue(){
          let self = this
          self.upstate({key:'public_bc',val:false})
          self.$emit('backParameter',true)
        },
        //打印押金
        printDetail(){
          let self = this
          self.$http.post(self.conURL + 'hotel/hotel/printdeposit',{payment_id:self.parameter_3.payId}).then(ress => {
            if(ress.data.code == 0){
              self.upstate({key:'jzPrint',val:ress.data.data})
            }else {
              self.createMess(ress.data.msg)
            }
          })
        },
        /*-----------------------入住信息方法-------------------------------*/
        //减少一条入住信息
        reducePeople(index){
          let self = this
          self.checkList.splice(index,1)
        },
        //增加一条入住信息
        addPeople(){
          let self = this
          self.checkList.push({
            name:'',
            cardType:'身份证',
            cardId:''
          })
        },
        //确认登记
        submit(){
          let self = this
          self.upstate({key:'public_is_Loading',val:true}) //加载中显示
          let newArr = []
          for (let i = 0; i < self.checkList.length; i++){
            let id_type
            if (self.checkList[i].cardType == '身份证'){
              id_type = 1
            }else if (self.checkList[i].cardType == '护照'){
              id_type = 2
            }else if (self.checkList[i].cardType == '军官证'){
              id_type = 3
            }else if (self.checkList[i].cardType == '驾驶证'){
              id_type = 4
            }else {
              id_type = ''
            }
            newArr.push({
              name:self.checkList[i].name,
              id_type:id_type,
              id_card:self.checkList[i].cardId,
            })
          }
          self.$http.post(self.conURL + 'hotel/work/checkin',{
            order_house_id:self.parameter_4.roomId,
            guest:newArr
          }).then(res => {
            if (res.data.code == 0){
              let dataResult = res.data.data
              let parameter = { //生成订单信息
                order_id:dataResult.id, //订单ID
                order_No:dataResult.no, //订单编号
                orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                orderPeopleId:dataResult.member_id, //会员ID
                orderPeopleName:dataResult.book_name, //预定人
                orderPeopleTel:dataResult.book_phone, //预订人电话
                orderCreatedId:dataResult.creator_id, //创建人ID
                orderCreatedName:dataResult.creator_name, //创建人姓名
                orderCreatedTime:dataResult.created_at, //创建时间
                orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                otaName:dataResult.ota_name, //OTA名称
                ota_order_type:dataResult.ota_order_type, //OTA类型
                otaNo:dataResult.ota_no, //OTA单号
                orderRemarks:dataResult.note, //备注
                orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                order_parameter:dataResult.order_houses, //房间列表
                orderNextPay:dataResult.nextpay, //第一次支付
                orderPayments:dataResult.payments, //收支明细
              }
              self.upstate({key:'publicOrderInfo',val:parameter})
              self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
              self.$emit('chekIn',dataResult.printData)
              // self.$emit('close',true)
              // self.$emit('refreshTheListOrder',true)
            }else {
              self.createMess(res.data.msg)
              self.upstate({key:'public_is_Loading',val:false}) //加载中显示
            }
          })
        },
        //关闭
        close(){
          let self = this
          self.$emit('close',true)
        },
        //转换证件类型
        returnIdCard(idCard){
          let self = this
          // 1=身份证 2=护照 3=军官证 4=驾驶证 5=港澳通行证
          if (idCard == 1){
            return '身份证'
          }else if (idCard == 2){
            return '护照'
          }else if (idCard == 3){
            return '军官证'
          }else if (idCard == 4){
            return '驾驶证'
          }else if (idCard == 5){
            return '港澳通行证'
          }
        },
        /*-----------------------订单对账板块方法-------------------------------*/
        //点击确认或质疑
        buttonSubmit(index){
          let self = this
          self.$http.post(self.conURL + 'hotel/work/completeorderconfirm',{
            order_id:self.parameter_5.settlement.order_id,
            check_type:index,
            note:self.RC_input
          }).then(res => {
            if (res.data.code == 0){
              this.$message({
                message: '操作成功',
                type: 'success'
              });
              setTimeout(() => {
                self.$emit('done',true)
                self.upstate({key:'public_bc',val:false})
              },1000)
            }else {
              self.createMess(res.data.msg)
            }
          })
        },
        /*-----------------------换房板块方法-------------------------------*/
        //关闭换房
        closeChangeRoom(){
          let self = this
          /*数据初始化*/
          self.oldRoomId = ''
          self.oldRoomNo = ''
          self.oldRoomType = ''
          self.changeRoomType_selectValue = ''
          self.changeRoom_radio = ''
          self.changeRoomTypeList = []
          self.changeRoomList = []
          /*初始化结束*/
          self.$emit('closeJust',true)
        },
        //选择房型
        chooseRoomType(val){
          let self = this
          let newArr = []
          let newArr2 = []
          for (let i = 0; i < self.parameter_6.parameter.roomList.length; i++){
            //将房间列表放入视图层
            if (val == self.parameter_6.parameter.roomList[i].id){
              for (let n = 0; n < self.parameter_6.parameter.roomList[i].rssc_houses.length; n++){
                if (self.parameter_6.parameter.roomList[i].rssc_houses[n].book_lock_status == 0){
                  newArr.push({
                    house_id:self.parameter_6.parameter.roomList[i].rssc_houses[n].id,
                    house_no:self.parameter_6.parameter.roomList[i].rssc_houses[n].no
                  })
                }
              }
              //将换房价格、时间放入视图层
              for (let x = 0; x < self.parameter_6.parameter.roomList[i].prices.length; x++){
                newArr2.push({
                  effected_at:self.parameter_6.parameter.roomList[i].prices[x].date,
                  price:self.parameter_6.parameter.roomList[i].prices[x].price
                })
              }
            }
          }
          self.changeRoomList = newArr
          if (self.changeRoomList.length > 0){
            self.changeDays = newArr2
          }
        },
        //确认换房
        changeHouse(){
          let self = this
          // self.$emit('close',true) //将收支信息回传(收费弹窗)
          self.upstate({key:'public_is_Loading',val:true})
          self.$http.post(self.conURL + 'hotel/work/changehouse',{
            order_house_id:self.parameter_6.order_house_id,
            note:self.changeRoomNote,
            house_id:self.changeRoom_radio,
            priceList:self.changeDays
          }).then(res => {
            if (res.data.code == 0){
              this.$message({
                message: '换房成功',
                type: 'success'
              });
              let dataResult = res.data.data
              let parameter = { //生成订单信息
                order_id:dataResult.id, //订单ID
                order_No:dataResult.no, //订单编号
                orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                orderPeopleId:dataResult.member_id, //会员ID
                orderPeopleName:dataResult.book_name, //预定人
                orderPeopleTel:dataResult.book_phone, //预订人电话
                orderCreatedId:dataResult.creator_id, //创建人ID
                orderCreatedName:dataResult.creator_name, //创建人姓名
                orderCreatedTime:dataResult.created_at, //创建时间
                orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                otaName:dataResult.ota_name, //OTA名称
                ota_order_type:dataResult.ota_order_type, //OTA类型
                otaNo:dataResult.ota_no, //OTA单号
                orderRemarks:dataResult.note, //备注
                orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                order_parameter:dataResult.order_houses, //房间列表
                orderNextPay:dataResult.nextpay, //第一次支付
                payCount:dataResult.payCount, //收支详情板块的三个数据
                payments:dataResult.payments, //收支详情列表
              }
              // console.log(parameter,'parameter')
              self.upstate({key:'publicOrderInfo',val:parameter})
              self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
              self.upstate({key:'public_is_Loading',val:false})
              self.$emit('changeRoomP',dataResult.printData)
            }else {
              self.createMess(res.data.msg)
              self.$emit('refreshTheListOrder',true)
            }
          })
        },
        /*-----------------------续房板块方法-------------------------------*/
        //关闭续房
        closeContinued(){
          let self = this
          /*数据初始化*/
          self.oldRoomId_continued = ''
          self.oldRoomNo_continued = ''
          self.oldRoomType_continued = ''
          self.continuedNote = ''
          /*初始化结束*/
          self.$emit('close',true)
        },
        //增加续房天数
        addDay(index){
          let self = this
          if (self.houseDaysList_show.length < self.houseDaysList.max_night){
            self.houseDaysList_show.push(self.houseDaysList.priceList[index + 1])
          }else {
            if (self.houseDaysList.max_night == 10){
              this.$message.error('一个房间单次操作最多续十天');
            }else {
              this.$message.error('该房间' + self.houseDaysList.booked_date + '已被预订');
            }
          }
        },
        //删除续房天数
        deleteDay(index){
          let self = this
          self.houseDaysList_show.splice(index,1)
        },
        //确认续房
        continuedHouse(){
          let self = this
          let order_houst_id = self.oldRoomId_continued
          self.upstate({key:'public_is_Loading',val:true})
          self.$http.post(self.conURL + 'hotel/work/extendhouse',{
            order_house_id:order_houst_id,
            priceList:self.houseDaysList_show
          }).then(res => {
            if (res.data.code == 0){
              this.$message({
                message: '续房成功',
                type: 'success'
              });
              let dataResult = res.data.data
              let parameter = { //生成订单信息
                order_id:dataResult.id, //订单ID
                order_No:dataResult.no, //订单编号
                orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                orderPeopleId:dataResult.member_id, //会员ID
                orderPeopleName:dataResult.book_name, //预定人
                orderPeopleTel:dataResult.book_phone, //预订人电话
                orderCreatedId:dataResult.creator_id, //创建人ID
                orderCreatedName:dataResult.creator_name, //创建人姓名
                orderCreatedTime:dataResult.created_at, //创建时间
                orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                otaName:dataResult.ota_name, //OTA名称
                ota_order_type:dataResult.ota_order_type, //OTA类型
                otaNo:dataResult.ota_no, //OTA单号
                orderRemarks:dataResult.note, //备注
                orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                order_parameter:dataResult.order_houses, //房间列表
                orderNextPay:dataResult.nextpay, //第一次支付
                payCount:dataResult.payCount, //收支详情板块的三个数据
                payments:dataResult.payments, //收支详情列表
              }
              // console.log(parameter,'parameter')
              self.upstate({key:'publicOrderInfo',val:parameter})
              self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
              self.upstate({key:'public_is_Loading',val:false})
              self.$emit('close',true)
              /*数据初始化*/
              self.oldRoomId_continued = ''
              self.oldRoomNo_continued = ''
              self.oldRoomType_continued = ''
              self.continuedNote = ''
              /*初始化结束*/
              self.$emit('refreshTheListOrder',true)
            }else {
              self.createMess(res.data.msg)
            }
          })
        },
        /*-----------------------提前退房板块方法-------------------------------*/
        //单选框选择
        activeChoose(index){
          let self = this
          let newArr = []
          //找到第一个ture的位置
          let ind = 10000
          for (let i = 0; i < self.activeList.length; i++){
            if (self.activeList[i]){
              ind = i
              break
            }
          }
          if (!self.activeList[index]){
            for (let i = 0; i < self.activeList.length; i++){
              if (i <= index){
                newArr.push(false)
              }else {
                newArr.push(true)
              }
            }
          }else {
            for (let i = 0; i < self.activeList.length; i++){
              if (i < index){
                newArr.push(false)
              }else {
                newArr.push(true)
              }
            }
          }
          //如果点击的位置在第一个true之后，将它变成true
          if (index > ind){
            newArr[index] = true
          }
          self.activeList = newArr
        },
        //取消退房
        closeCheckOut(){
          let self = this
          /*数据初始化*/
          self.checkOutRmark = ''
          self.checkOutList = []
          self.activeList = []
          /*初始化结束*/
          self.$emit('close',true)
        },
        //确认退房
        confirmCheckOut(){
          let self = this
          let newArr = []
          if (self.parameter_8.data != undefined){
            let chekType
            if (self.outTimeRadio == 0){
              chekType = 2
            }else if (self.outTimeRadio == 1){
              chekType = 1
            }else if (self.outTimeRadio == 2){
              chekType = 0
            }
            let money = self.outTimeMoney
            let note = self.outTimeRmark
            this.$confirm('是否退房?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              self.upstate({key:'public_is_Loading',val:true})
              self.$http.post(self.conURL + 'hotel/work/checkout',{
                order_house_id:self.parameter_8.order_house_id,
                check_out_type:2,
                overtime_money:money,
                check_type:chekType,
                note:note
              }).then(res => {
                if (res.data.code == 0){
                  this.$message({
                    type: 'success',
                    message: '退房成功!'
                  });
                  let dataResult = res.data.data
                  let parameter = { //生成订单信息
                    order_id:dataResult.id, //订单ID
                    order_No:dataResult.no, //订单编号
                    orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                    orderPeopleId:dataResult.member_id, //会员ID
                    orderPeopleName:dataResult.book_name, //预定人
                    orderPeopleTel:dataResult.book_phone, //预订人电话
                    orderCreatedId:dataResult.creator_id, //创建人ID
                    orderCreatedName:dataResult.creator_name, //创建人姓名
                    orderCreatedTime:dataResult.created_at, //创建时间
                    orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                    orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                    otaName:dataResult.ota_name, //OTA名称
                    ota_order_type:dataResult.ota_order_type, //OTA类型
                    otaNo:dataResult.ota_no, //OTA单号
                    orderRemarks:dataResult.note, //备注
                    orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                    order_parameter:dataResult.order_houses, //房间列表
                    orderNextPay:dataResult.nextpay, //第一次支付
                    payCount:dataResult.payCount, //收支详情板块的三个数据
                    payments:dataResult.payments, //收支详情列表
                  }
                  // console.log(parameter,'parameter')
                  self.upstate({key:'publicOrderInfo',val:parameter})
                  self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                  self.upstate({key:'public_is_Loading',val:false})
                  self.$emit('refreshTheListOrder',true)
                  self.closeCheckOut()
                }else {
                  self.createMess(res.data.msg)
                  self.upstate({key:'public_is_Loading',val:false})
                }
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          }else {
            for (let i = 0; i < self.checkOutList.length; i++){
              if (self.activeList[i]){
                newArr.push({
                  effected_at:self.checkOutList[i].effected_at,
                  price:self.checkOutList[i].price
                })
              }
            }
            if (newArr.length > 0){
              this.$confirm('是否退房?', '提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
              }).then(() => {
                self.upstate({key:'public_is_Loading',val:true})
                self.$http.post(self.conURL + 'hotel/work/checkout',{
                  order_house_id:self.parameter_8.order_house_id,
                  check_out_type:self.parameter_8.check_out_type,
                  houseList:newArr
                }).then(res => {
                  if (res.data.code == 0){
                    this.$message({
                      type: 'success',
                      message: '退房成功!'
                    });
                    let dataResult = res.data.data
                    let parameter = { //生成订单信息
                      order_id:dataResult.id, //订单ID
                      order_No:dataResult.no, //订单编号
                      orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                      orderPeopleId:dataResult.member_id, //会员ID
                      orderPeopleName:dataResult.book_name, //预定人
                      orderPeopleTel:dataResult.book_phone, //预订人电话
                      orderCreatedId:dataResult.creator_id, //创建人ID
                      orderCreatedName:dataResult.creator_name, //创建人姓名
                      orderCreatedTime:dataResult.created_at, //创建时间
                      orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                      orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                      otaName:dataResult.ota_name, //OTA名称
                      ota_order_type:dataResult.ota_order_type, //OTA类型
                      otaNo:dataResult.ota_no, //OTA单号
                      orderRemarks:dataResult.note, //备注
                      orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                      order_parameter:dataResult.order_houses, //房间列表
                      orderNextPay:dataResult.nextpay, //第一次支付
                      payCount:dataResult.payCount, //收支详情板块的三个数据
                      payments:dataResult.payments, //收支详情列表
                    }
                    // console.log(parameter,'parameter')
                    self.upstate({key:'publicOrderInfo',val:parameter})
                    self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                    self.upstate({key:'public_is_Loading',val:false})
                    self.$emit('refreshTheListOrder',true)
                    self.closeCheckOut()
                  }else {
                    self.createMess(res.data.msg)
                    self.upstate({key:'public_is_Loading',val:false})
                  }
                })
              }).catch(() => {
                this.$message({
                  type: 'info',
                  message: '已取消删除'
                });
              });
            }else {
              self.closeCheckOut()
            }
          }
        },
        /*-----------------------取消房间板块方法-------------------------------*/
        confirmCancel(){
          let self = this
          let newArr = []
          for (let i = 0; i < self.checkOutList.length; i++){
            if (self.activeList[i]){
              newArr.push({
                effected_at:self.checkOutList[i].effected_at,
                price:self.checkOutList[i].price
              })
            }
          }
          if (newArr.length > 0){
            this.$confirm('是否取消?', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              self.upstate({key:'public_is_Loading',val:true})
              self.$http.post(self.conURL + 'hotel/work/cancelhouse',{
                order_house_id:self.parameter_8.order_house_id,
                houseList:newArr,
                note:self.checkOutRmark,
              }).then(res => {
                if (res.data.code == 0){
                  this.$message({
                    type: 'success',
                    message: '取消成功!'
                  });
                  let dataResult = res.data.data
                  let parameter = { //生成订单信息
                    order_id:dataResult.id, //订单ID
                    order_No:dataResult.no, //订单编号
                    orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                    orderPeopleId:dataResult.member_id, //会员ID
                    orderPeopleName:dataResult.book_name, //预定人
                    orderPeopleTel:dataResult.book_phone, //预订人电话
                    orderCreatedId:dataResult.creator_id, //创建人ID
                    orderCreatedName:dataResult.creator_name, //创建人姓名
                    orderCreatedTime:dataResult.created_at, //创建时间
                    orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                    orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                    otaName:dataResult.ota_name, //OTA名称
                    ota_order_type:dataResult.ota_order_type, //OTA类型
                    otaNo:dataResult.ota_no, //OTA单号
                    orderRemarks:dataResult.note, //备注
                    orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                    order_parameter:dataResult.order_houses, //房间列表
                    orderNextPay:dataResult.nextpay, //第一次支付
                    payCount:dataResult.payCount, //收支详情板块的三个数据
                    payments:dataResult.payments, //收支详情列表
                  }
                  // console.log(parameter,'parameter')
                  self.upstate({key:'publicOrderInfo',val:parameter})
                  self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                  self.upstate({key:'public_is_Loading',val:false})
                  self.$emit('refreshTheListOrder',true)
                  self.closeCheckOut()
                }else {
                  self.createMess(res.data.msg)
                }
              })
            }).catch(() => {
              this.$message({
                type: 'info',
                message: '已取消删除'
              });
            });
          }else {
            self.closeCheckOut()
          }
        },
        /*-----------------------冲调板块方法-------------------------------*/
        //冲调方式变化
        flushingChange(){
          let self = this
          if (self.flushing_radio == 1){
            self.flushing_money = 0
          }else {
            self.flushing_money = self.flushing_total_money
          }
        },
        //冲调输入框失去焦点
        flushing_blur(){
          let self = this
          if (!isNaN(self.flushing_money)){
            if (parseFloat(self.flushing_money) >= parseFloat(self.flushing_total_money)){
              self.flushing_radio = '2'
              self.flushing_money = self.flushing_total_money
            }
          }else {
            self.createMess('冲调金额有误')
            self.upstate({key:'public_bc',val:true})
          }
        },
        //冲调确认
        flushingConfirm(){
          let self = this
          if (self.flushing_money != 0 && self.flushing_money != '' && !isNaN(self.flushing_money)){
            if (self.flushing_note != ''){
              self.upstate({key:'public_is_Loading',val:true}) //加载中显示
              self.$http.post(self.conURL + 'hotel/work/createwriteoff',{
                payment_id:self.parameter_12.payment_id,
                money:self.flushing_money,
                note:self.flushing_note
              }).then(res => {
                if (res.data.code == 0){
                  let dataResult = res.data.data
                  let parameter = { //生成订单信息
                    order_id:dataResult.id, //订单ID
                    order_No:dataResult.no, //订单编号
                    orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                    orderPeopleId:dataResult.member_id, //会员ID
                    orderPeopleName:dataResult.book_name, //预定人
                    orderPeopleTel:dataResult.book_phone, //预订人电话
                    orderCreatedId:dataResult.creator_id, //创建人ID
                    orderCreatedName:dataResult.creator_name, //创建人姓名
                    orderCreatedTime:dataResult.created_at, //创建时间
                    orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                    orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                    otaName:dataResult.ota_name, //OTA名称
                    ota_order_type:dataResult.ota_order_type, //OTA类型
                    otaNo:dataResult.ota_no, //OTA单号
                    orderRemarks:dataResult.note, //备注
                    orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                    order_parameter:dataResult.order_houses, //房间列表
                    orderNextPay:dataResult.nextpay, //第一次支付
                    orderPayments:dataResult.payments, //收支明细
                  }
                  self.upstate({key:'publicOrderInfo',val:parameter})
                  self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                  self.upstate({key:'public_is_Loading',val:false}) //加载中显示
                  this.$message({
                    message: '操作成功',
                    type: 'success'
                  });
                  self.$emit('chekIn',dataResult.printData)
                  setTimeout(() => {
                    self.$emit('flushingDone',true)
                  },1500)
                }else {
                  self.createMess(res.data.msg)
                  self.upstate({key:'public_bc',val:true})
                }
              })
            }else {
              self.createMess('备注不能为空')
              self.upstate({key:'public_bc',val:true})
            }
          }else {
            self.createMess('冲调金额有误')
            self.upstate({key:'public_bc',val:true})
          }
        },
        //冲调取消
        flushingClose(){
          let self = this
          self.$emit('close',true)
        },
        /*-----------------------单个房间详情板块方法-------------------------------*/
        closeHouseDetail(){
          let self = this
          self.$emit('close',true)
        },
        /*-----------------------交班板块方法-------------------------------*/
        //取消
        shifts_close(){
          let self = this
          self.$emit('close',true)
        },
        //确认
        shifts_confirm(){
          let self = this
          self.$http.post(self.conURL + 'hotel/work/showhandover',{
            submit:true,
          }).then(res => {
            self.shifts_close()
            if (res.data.code == 0){
              this.$alert('保存交接班记录成功', {
                confirmButtonText: '确定',
              });
            }else {
              self.createMess(res.data.msg)
            }
          })
        },
        //现金上交金额变化
        inputUpChange(val){
          let self = this
          if (parseInt(val) > self.parameter_9.total_cash_money){
            self.shiftsInput_up = self.parameter_9.total_cash_money
          }
          let inputDown = self.parameter_9.total_cash_money - val
          if (inputDown <= 0){
            self.shiftsInput_down = 0
          }else {
            self.shiftsInput_down = inputDown
          }
        },
        /*-----------------------酒店吧板块方法-------------------------------*/
        //获取酒店商品列表
        getBarList(id){
          let self = this
          let barList = JSON.parse(sessionStorage.getItem('barList'))
          let newArr = [] //临时的商品品类列表
          for (let i = 0; i < barList.length; i++){
            newArr.push({
              value:barList[i].id,
              label:barList[i].name
            })
          }
          newArr.unshift({
            value:0,
            label:'全部品类'
          })
          self.commodityList = newArr
          let newArr2 = [] //临时的商品列表
          for (let x = 0; x < barList.length; x++){
            for (let y = 0; y < barList[x].goods.length; y++){
              if (id == 0){
                newArr2.push({
                  id:barList[x].goods[y].id,
                  category: barList[x].goods[y].category_id,
                  name: barList[x].goods[y].name,
                  unit:barList[x].goods[y].company,
                  price: barList[x].goods[y].price,
                })
              }else {
                if (id == barList[x].goods[y].category_id){
                  newArr2.push({
                    id:barList[x].goods[y].id,
                    category: barList[x].goods[y].category_id,
                    name: barList[x].goods[y].name,
                    unit:barList[x].goods[y].company,
                    price: barList[x].goods[y].price,
                  })
                }
              }
            }
          }
          self.shops = newArr2
        },
        //品类筛选
        commodityChange(val){
          let self = this
          self.getBarList(val)
        },
        //添加商品
        addShop(id){
          let self = this
          if (self.addShops.indexOf(id) == -1){
            self.addShops.push(id)
          }
        },
        //移除商品
        deleteShop(id){
          let self = this
          for (let i = 0; i < self.addShops.length; i++){
            if (id == self.addShops[i]){
              self.addShops.splice(i, 1);
            }
          }
        },
        //商品价格变化
        rowPriceChange(val){
          let self = this
          self.Calculation(val)
        },
        //商品数量变化
        addNumChange(val){
          let self = this
          self.Calculation(val)
        },
        //已添加商品，单行总价计算
        Calculation(val){
          let self = this
          setTimeout(() => {
            for (let i = 0;i < self.addShopsList.length; i++){
              if (val.shopId == self.addShopsList[i].shopId){
                self.addShopsList[i].totalPrice = parseFloat(val.price) * parseFloat(val.addNum)
              }
            }
            let total = 0
            for (let i = 0; i < self.addShopsList.length; i++){
              total += parseFloat(self.addShopsList[i].totalPrice)
            }
            self.payMoney = total.toFixed(2)
          },50)
        },
        /*-----------------------微信退款板块方法-------------------------------*/
        //取消
        wxRefundClose(){
          let self = this
          self.$emit('close',true)
        },
        //确认
        refundClick(){
          let self = this
          let money = self.wxRefundInput
          if (!isNaN(money)){
            if (money <= self.parameter_10.maxRefund.money){
              self.$http.post(self.conURL + 'hotel/work/createweixinrefund',{
                payment_id:self.parameter_10.maxRefund.id,
                money:money,
                note:self.wxRefundNote
              }).then(res => {
                if (res.data.code == 0){
                  let dataResult = res.data.data
                  let parameter = { //生成订单信息
                    order_id:dataResult.id, //订单ID
                    order_No:dataResult.no, //订单编号
                    orderStatus:dataResult.order_status, //订单状态  0=未确认，1=已确认，2=已取消，3=已完成，4=已结算
                    orderPeopleId:dataResult.member_id, //会员ID
                    orderPeopleName:dataResult.book_name, //预定人
                    orderPeopleTel:dataResult.book_phone, //预订人电话
                    orderCreatedId:dataResult.creator_id, //创建人ID
                    orderCreatedName:dataResult.creator_name, //创建人姓名
                    orderCreatedTime:dataResult.created_at, //创建时间
                    orderType:dataResult.is_share_time, //订单类型 0：普通订单 1：分时订单
                    orderSource:dataResult.origin, //订单来源 0=前台，1=微信，2=OTA
                    otaName:dataResult.ota_name, //OTA名称
                    ota_order_type:dataResult.ota_order_type, //OTA类型
                    otaNo:dataResult.ota_no, //OTA单号
                    orderRemarks:dataResult.note, //备注
                    orderRoomTypevalue:dataResult.check_type, //开房类型 0:全日房 1:钟点房 2:免费房 3:特殊房
                    order_parameter:dataResult.order_houses, //房间列表
                    orderNextPay:dataResult.nextpay, //第一次支付
                    payCount:dataResult.payCount, //收支详情板块的三个数据
                    payments:dataResult.payments, //收支详情列表
                  }
                  self.upstate({key:'publicOrderInfo',val:parameter})
                  self.upstate({key:'payInfo',val:dataResult.payments}) //将收支明细回传
                  self.upstate({key:'public_is_Loading',val:false})
                  self.wxRefundClose()
                }else {
                  self.createMess(res.data.msg)
                }
              })
            }else {
              this.$alert('您输入的金额超过当前最大退款金额' + self.parameter_10.maxRefund.money + '，请重新输入', {
                confirmButtonText: '确定',
                callback: action => {
                  $('#wxRefundInput').focus()
                }
              });
            }
          }else {
            this.$alert('您输入的金额有误，请重新输入', {
              confirmButtonText: '确定',
              callback: action => {
                $('#wxRefundInput').focus()
              }
            });
          }
        },
      }
    }
</script>

<style src="../../assets/less/alertAss.less" lang="less" scoped></style>
